//
//  SEEventReceiver.h
//  Space Explorer
//
//  Created by Yann Blaudin de Thé on 13/04/13.
//  Copyright (c) 2013 TeaTime. All rights reserved.
//

#ifndef __Space_Explorer__SEEventReceiver__
#define __Space_Explorer__SEEventReceiver__

#include <iostream>
#include <vector>
#include <irrlicht.h>

#include "SEPlanet.h"
#include "SEMisc.h"
#include "SEWorld.h"


class SEEventReceiver : public irr::IEventReceiver {
private:
    // We use this array to store the current state of each key
    bool KeyIsDown[irr::KEY_KEY_CODES_COUNT];
    
    irr::IrrlichtDevice *_device;
    
    bool _shift;
    
    SEWorld* _world;
    
    bool _wireframe;
    
    irr::core::position2d<irr::f32> _cursor_pos;
    
public:
    SEEventReceiver();
    
    virtual bool OnEvent(const irr::SEvent&);
    
    void traite_evenements();
    
    // This is used to check whether a key is being held down
    virtual bool IsKeyDown(irr::EKEY_CODE keyCode) const;
    
    bool IsShifted() const;
    
    void resetKey(irr::EKEY_CODE keyCode);
    
    void setWorld(SEWorld* world);
    
};
    
#endif /* defined(__Space_Explorer__SEEventReceiver__) */
